package ar.com.photo_admin.service

import ar.com.photo_admin.domain.User

class UserService {

	static transactional = true
	
    def save(User user) {
		return user.save(flush : true)
    }
	
	def findByUsernameOrEmail(String userId) {
		return userId?.contains("@") ? User.findByEmail(userId) : User.findByUsername(userId)
	}
}
